package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_goods_category", schema = "", catalog = "onedollar")
public class TGoodsCategoryEntity {
    private int catId;
    private String catName;
    private String keywords;
    private String catDesc;
    private String catImg;
    private Integer level;
    private Integer parentId;
    private Integer sortOrder;
    private String measureUnit;
    private Integer isShow;
    private Integer status;

    @Id
    @Column(name = "cat_id", nullable = false, insertable = true, updatable = true)
    public int getCatId() {
        return catId;
    }

    public void setCatId(int catId) {
        this.catId = catId;
    }

    @Basic
    @Column(name = "cat_name", nullable = true, insertable = true, updatable = true, length = 80)
    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    @Basic
    @Column(name = "keywords", nullable = true, insertable = true, updatable = true, length = 100)
    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    @Basic
    @Column(name = "cat_desc", nullable = true, insertable = true, updatable = true, length = 100)
    public String getCatDesc() {
        return catDesc;
    }

    public void setCatDesc(String catDesc) {
        this.catDesc = catDesc;
    }

    @Basic
    @Column(name = "cat_img", nullable = true, insertable = true, updatable = true, length = 200)
    public String getCatImg() {
        return catImg;
    }

    public void setCatImg(String catImg) {
        this.catImg = catImg;
    }

    @Basic
    @Column(name = "level", nullable = true, insertable = true, updatable = true)
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Basic
    @Column(name = "parent_id", nullable = true, insertable = true, updatable = true)
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "sort_order", nullable = true, insertable = true, updatable = true)
    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    @Basic
    @Column(name = "measure_unit", nullable = true, insertable = true, updatable = true, length = 20)
    public String getMeasureUnit() {
        return measureUnit;
    }

    public void setMeasureUnit(String measureUnit) {
        this.measureUnit = measureUnit;
    }

    @Basic
    @Column(name = "is_show", nullable = true, insertable = true, updatable = true)
    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TGoodsCategoryEntity that = (TGoodsCategoryEntity) o;

        if (catId != that.catId) return false;
        if (catName != null ? !catName.equals(that.catName) : that.catName != null) return false;
        if (keywords != null ? !keywords.equals(that.keywords) : that.keywords != null) return false;
        if (catDesc != null ? !catDesc.equals(that.catDesc) : that.catDesc != null) return false;
        if (catImg != null ? !catImg.equals(that.catImg) : that.catImg != null) return false;
        if (level != null ? !level.equals(that.level) : that.level != null) return false;
        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
        if (sortOrder != null ? !sortOrder.equals(that.sortOrder) : that.sortOrder != null) return false;
        if (measureUnit != null ? !measureUnit.equals(that.measureUnit) : that.measureUnit != null) return false;
        if (isShow != null ? !isShow.equals(that.isShow) : that.isShow != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = catId;
        result = 31 * result + (catName != null ? catName.hashCode() : 0);
        result = 31 * result + (keywords != null ? keywords.hashCode() : 0);
        result = 31 * result + (catDesc != null ? catDesc.hashCode() : 0);
        result = 31 * result + (catImg != null ? catImg.hashCode() : 0);
        result = 31 * result + (level != null ? level.hashCode() : 0);
        result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
        result = 31 * result + (sortOrder != null ? sortOrder.hashCode() : 0);
        result = 31 * result + (measureUnit != null ? measureUnit.hashCode() : 0);
        result = 31 * result + (isShow != null ? isShow.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }
}
